package graphics.Meshes;

import common.Math3D;
import common.Point3D;


public class Trigon {
	public Point3D p0,p1,p2;
	Point3D normal;
	
	public Trigon(Point3D p0, Point3D p1, Point3D p2){
		this.p0 = p0;
		this.p1 = p1;
		this.p2 = p2;
		recalculateNormal();
	}

	public void recalculateNormal(){
		normal = Math3D.getNormal(p0, p1, p2);
		normal.normalize();
	}
	
	public Point3D getP0() {
		return p0;
	}

	public void setP0(Point3D p0) {
		this.p0 = p0;
	}

	public Point3D getP1() {
		return p1;
	}

	public void setP1(Point3D p1) {
		this.p1 = p1;
	}

	public Point3D getP2() {
		return p2;
	}

	public void setP2(Point3D p2) {
		this.p2 = p2;
	}

	public Point3D getNormal() {
		return normal;
	}

	public void setNormal(Point3D normal) {
		this.normal = normal;
	}


}
